#include <bits/stdc++.h>

using namespace std;

const int M1=998244353,M2=1004535809,M3=469762049,E=524288,N=200005;
struct poly{
    const int M;
    poly(int _M):M(_M){}
    int R[N*4];
    long long qpow(long long a,long long b){
        long long ans=1;
        while(b){
            if(b&1)
                ans=ans*a%M;
            a=a*a%M;
            b>>=1;
        }
        return ans;
    }
    long long wn[N*4],iwn[N*4],inv[N*4],fac[N*4],ifac[N*4];
    void init(int E,int g){
        int i;
        iwn[E/2]=wn[E/2]=1;
        long long s1=qpow(g,(M-1)/E);
        long long s2=qpow(s1,M-2);
        for(i=E/2+1;i<E;++i){
            wn[i]=wn[i-1]*s1%M;
            iwn[i]=iwn[i-1]*s2%M;
        }
        for(i=E/2-1;i;--i){
            wn[i]=wn[i<<1];
            iwn[i]=iwn[i<<1];
        }
        ifac[0]=fac[0]=inv[1]=1;
        for(i=2;i<E;++i)
            inv[i]=inv[M%i]*(M-M/i)%M;
        for(i=1;i<E;++i){
            ifac[i]=inv[i]*ifac[i-1]%M;
            fac[i]=fac[i-1]*i%M;
        }
    }
    unsigned long long ccc[N*4];
    void NTT(long long *f,int lim,int op){
        int i,j,k;
        for(i=0;i<lim;++i){
            R[i]=(R[i>>1]>>1)|(i&1?lim>>1:0);
            if(R[i]<i)
                swap(f[R[i]],f[i]);
        }
        for(i=0;i<lim;++i)
            ccc[i]=(f[i]%M+M)%M;
        for(i=1;i<lim;i<<=1)
            for(j=0;j<lim;j+=(i<<1))
                for(k=j;k<j+i;++k){
                    long long w=(op==1?wn[k-j+i]:iwn[k-j+i]);
                    unsigned long long p=ccc[k+i]*w%M;
                    ccc[k+i]=ccc[k]+M-p;
                    ccc[k]+=p;
                }
        for(i=0;i<lim;++i)
            f[i]=ccc[i]%M;
        if(op==-1){
            long long inv=qpow(lim,M-2);
            for(i=0;i<lim;++i)
                f[i]=f[i]*inv%M;
        }
    }
    long long ta[N*4],tb[N*4];
    void mult(long long *a,int n,long long *b,int m,long long *c){
        int lim=1;
        while(lim<n+m)
            lim<<=1;
        copy(a,a+n,ta);
        copy(b,b+m,tb);
        for(int i=n;i<lim;++i)
            ta[i]=0;
        for(int i=m;i<lim;++i)
            tb[i]=0;
        NTT(ta,lim,1);
        NTT(tb,lim,1);
        for(int i=0;i<lim;++i)
            ta[i]=ta[i]*tb[i]%M;
        NTT(ta,lim,-1);
        copy(ta,ta+lim,c);
    }
}X(M1),Y(M2),Z(M3);
int n,m,o[N],t,tn;
long long a[N],b[N],c[N],d[N*4],e[N],f[N*4],ss[N],td[N],tf[N];
bool fl[N],zz;
vector<int> ans;
long long cal(int l,int r){
    return 1ll*(l+r)*(r-l+1)/2;
}
long long cal2(int u,int v){
    return 1ll*((v-u)/2+1)*(u+v)/2;
}
bool iok(int n,int p,int q){
    long long ss=q+1ll*(n/2)*(n/2+1);
    p=p+(n/2+1);
    long long mn=cal(0,p-1),mx=cal(n-p+1,n);
    if(mn<=ss&&ss<=mx){
        for(int i=n;i<n+m-2;++i)
            if(td[i]!=tf[i-n+1]&&td[i]!=tf[i-n+1]-1)
                return false;
        ss-=mn;
        for(int i=n;i<n+m-2;++i)
            if(td[i]!=tf[i-n+1])
                ans.push_back(i+2);
        fill(fl,fl+1+n,0);
        for(int i=0;i<p;++i)
            fl[(ss/p+(i>=p-ss%p)+i)]=1;
        for(int i=0;i<=n;++i)
            if(fl[i]^(i&1)^1)
                if(n+1-i<=tn)
                    ans.push_back(n+1-i);
        zz=true;
        return true;
    }
    return false;
}
void OT(){
    if(!zz)
        puts("-1");
    else{
        printf("%d\n",ans.size());
        for(auto it:ans)
            printf("%d ",it);
        printf("\n");
    }
}
void judgement(poly &v,long long *c,long long *e){
    for(int i=0;i<n-2;++i)
        d[i]=(c[i+1]+c[i+2])%v.M;
    for(int i=0;i<m-2;++i)
        f[i]=(e[i+1]+e[i+2])%v.M;
    reverse(f,f+m-2);
    long long s=0;
    for(int i=0;i<m-2;++i)
        s+=(f[i]*f[i]-f[i])%v.M;
    for(int i=1;i<=n-2;++i)
        ss[i]=(ss[i-1]+d[i-1]*(d[i-1]+1))%v.M;
    v.mult(d,n-2,f,m-2,d);
    for(int i=m-3;i<n-2;++i)
        if((s+ss[i+1]-ss[i-m+3]-2*d[i])%v.M!=0)
            o[i-m+4]=0;
}
int main(){
    X.init(E,3);
    Y.init(E,3);
    Z.init(E,3);
    scanf("%d",&t);
    while(t--){
        scanf("%d",&n);
        tn=n;
        for(int i=1;i<=n;++i)
            scanf("%lld",&a[i]);
        scanf("%d",&m);
        for(int i=1;i<=m;++i)
            scanf("%lld",&b[i]);
        for(int i=1;i<n;++i)
            c[i]=a[i]+a[i+1];
        for(int i=1;i<m;++i)
            e[i]=b[i]+b[i+1];
        fill(o,o+1+n,0);
        ans.clear();
        for(int i=1;i<=n;++i)
            o[i]=1;
        if(m>2){
            for(int i=0;i<n-2;++i)
                td[i+1]=c[i+1]+c[i+2];
            for(int i=0;i<m-2;++i)
                tf[i+1]=e[i+1]+e[i+2];
            judgement(X,c,e);
            judgement(Y,c,e);
            judgement(Z,c,e);
        }
        else
            for(int i=1;i<=n;++i)
                o[i]=1;
        int x=-1;
        zz=false;
        if(m==1){
            for(int i=1;i<=n;++i)
                if(-cal2(0,i/2*2)<=b[1]-a[i]&&b[1]-a[i]<=cal2(1,(i-1)/2*2+1)){
                    for(int j=-(i/2+1);j<=(i+1)/2;++j)
                        if(iok(i,j,b[1]-a[i]))
                            break;
                    break;
                }
        }
        else
            for(int i=1;i+m-1<=n;++i)
                if(o[i]&&iok(i,(a[i]+a[i+1])-(b[1]+b[2]),b[1]-a[i]))
                    break;
        OT();
    }
}